<script src='https://res.wx.qq.com/open/js/jweixin-1.3.2.js'></script>
<script>
    var appIdstr = "{$wx['appId']}";
    var timestampstr = "{$wx['timestamp']}";
    var nonceStrstr = "{$wx['nonceStr']}";
    var signaturestr = "{$wx['signature']}";
    wx.config({
        debug: false,
        appId: appIdstr,
        timestamp: timestampstr,
        nonceStr: nonceStrstr,
        signature: signaturestr,
        jsApiList : ['hideMenuItems']
    });
    wx.ready(function() {
        wx.checkJsApi({
            jsApiList: ['hideOptionMenu'],
            success: function (res) {
                if (res.checkResult.getLocation == false){
                    alert('你的微信版本太低，不支持微信JS接口，请升级到最新的微信版本！');
                    return;
                }
            }
        });
        wx.hideOptionMenu();
    });
    wx.error(function(res){
        console.log(res)
        // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。
    });
</script>